import App from './App'
	import  * as UniCloudApi from './common/uniCloudApi.js';
	import  * as publicApi from './common/publicApi.js';
  
  
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false

App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
	


import { createSSRApp } from 'vue'


export function createApp() {
  const app = createSSRApp(App)
  // var userInfo = uni.getStorageSync('userInfo')
  // app.config.globalProperties.$userInfo = userInfo// 将其添加到Vue原型链
  app.config.globalProperties.$uniCloudApi = UniCloudApi // 将其添加到Vue原型链
  app.config.globalProperties.$publicApi = publicApi // 将其添加到Vue原型链
  app.config.globalProperties.$isLogin = false // 将其添加到Vue原型链
  
  app.config.globalProperties.$showToast = function(text) {
    uni.showToast({
    	title:text,
  	icon: 'none'
    })
  };
  
  app.config.globalProperties.$setUserInfo = function(userData) {
  	// app.config.globalProperties.$userInfo = null;
   //    app.config.globalProperties.$userInfo = userData;
  	app.config.globalProperties.$isLogin = true;
  	console.log('设置登录数据22====',app.config.globalProperties.$isLogin);
  	// console.log('设置登录数据33====',userData);
  	
  };
  app.config.globalProperties.$removeUserInfo = function() {
  	console.log('删除登录数据====');
      // app.config.globalProperties.$userInfo = null;
  	app.config.globalProperties.$isLogin = false;
  	
  	// console.log('删除登录数据22====',app.config.globalProperties.$userInfo);
  };
  return {
    app
  }
}
// #endif